package com.imist.nettybasic4.client.console;

import com.imist.nettybasic4.protocol.request.MessageRequestPacket;
import io.netty.channel.Channel;

import java.util.Scanner;

public class SendToUserConsoleCommand implements ConsoleCommand {
    @Override
    public void exec(Scanner scanner, Channel channel) {
        System.out.println("发送消息给用户,先输入用户id再输入消息:");

        String toUserId = scanner.next();
        String message = scanner .next();
        channel.writeAndFlush(new MessageRequestPacket(toUserId,message));
    }
}
